package com.ruoyi.production.service.impl.plug;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.plug.PlugPurchaseApply;
import com.ruoyi.production.mapper.plug.PlugPurchaseApplyMapper;
import com.ruoyi.production.service.plug.IPlugPurchaseApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 穴盘购买申请Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class PlugPurchaseApplyServiceImpl implements IPlugPurchaseApplyService
{
    @Autowired
    private PlugPurchaseApplyMapper plugPurchaseApplyMapper;

    /**
     * 查询穴盘购买申请
     *
     * @param plugPurchaseApplyId 穴盘购买申请ID
     * @return 穴盘购买申请
     */
    @Override
    public PlugPurchaseApply selectPlugPurchaseApplyById(Long plugPurchaseApplyId)
    {
        return plugPurchaseApplyMapper.selectPlugPurchaseApplyById(plugPurchaseApplyId);
    }

    /**
     * 查询穴盘购买申请列表
     *
     * @param plugPurchaseApply 穴盘购买申请
     * @return 穴盘购买申请
     */
    @Override
    public List<PlugPurchaseApply> selectPlugPurchaseApplyList(PlugPurchaseApply plugPurchaseApply)
    {
        return plugPurchaseApplyMapper.selectPlugPurchaseApplyList(plugPurchaseApply);
    }

    /**
     * 新增穴盘购买申请
     *
     * @param plugPurchaseApply 穴盘购买申请
     * @return 结果
     */
    @Override
    public int insertPlugPurchaseApply(PlugPurchaseApply plugPurchaseApply)
    {
        plugPurchaseApply.setCreateTime(DateUtils.getNowDate());
        return plugPurchaseApplyMapper.insertPlugPurchaseApply(plugPurchaseApply);
    }

    /**
     * 修改穴盘购买申请
     *
     * @param plugPurchaseApply 穴盘购买申请
     * @return 结果
     */
    @Override
    public int updatePlugPurchaseApply(PlugPurchaseApply plugPurchaseApply)
    {
        plugPurchaseApply.setUpdateTime(DateUtils.getNowDate());
        return plugPurchaseApplyMapper.updatePlugPurchaseApply(plugPurchaseApply);
    }

    /**
     * 批量删除穴盘购买申请
     *
     * @param plugPurchaseApplyIds 需要删除的穴盘购买申请ID
     * @return 结果
     */
    @Override
    public int deletePlugPurchaseApplyByIds(Long[] plugPurchaseApplyIds)
    {
        return plugPurchaseApplyMapper.deletePlugPurchaseApplyByIds(plugPurchaseApplyIds);
    }

    /**
     * 删除穴盘购买申请信息
     *
     * @param plugPurchaseApplyId 穴盘购买申请ID
     * @return 结果
     */
    @Override
    public int deletePlugPurchaseApplyById(Long plugPurchaseApplyId)
    {
        return plugPurchaseApplyMapper.deletePlugPurchaseApplyById(plugPurchaseApplyId);
    }
}
